package com.homeparking.manage.service.impl;

import java.util.List;
import com.homeparking.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.homeparking.manage.mapper.ManageBuildingMapper;
import com.homeparking.manage.domain.ManageBuilding;
import com.homeparking.manage.service.IManageBuildingService;

/**
 * 楼栋Service业务层处理
 * 
 * @author liuyangyang
 * @date 2025-10-13
 */
@Service
public class ManageBuildingServiceImpl implements IManageBuildingService 
{
    @Autowired
    private ManageBuildingMapper manageBuildingMapper;

    /**
     * 查询楼栋
     * 
     * @param buildingId 楼栋主键
     * @return 楼栋
     */
    @Override
    public ManageBuilding selectManageBuildingByBuildingId(Long buildingId)
    {
        return manageBuildingMapper.selectManageBuildingByBuildingId(buildingId);
    }

    /**
     * 查询楼栋列表
     * 
     * @param manageBuilding 楼栋
     * @return 楼栋
     */
    @Override
    public List<ManageBuilding> selectManageBuildingList(ManageBuilding manageBuilding)
    {
        return manageBuildingMapper.selectManageBuildingList(manageBuilding);
    }

    /**
     * 新增楼栋
     * 
     * @param manageBuilding 楼栋
     * @return 结果
     */
    @Override
    public int insertManageBuilding(ManageBuilding manageBuilding)
    {
        manageBuilding.setCreateTime(DateUtils.getNowDate());
        return manageBuildingMapper.insertManageBuilding(manageBuilding);
    }

    /**
     * 修改楼栋
     * 
     * @param manageBuilding 楼栋
     * @return 结果
     */
    @Override
    public int updateManageBuilding(ManageBuilding manageBuilding)
    {
        manageBuilding.setUpdateTime(DateUtils.getNowDate());
        return manageBuildingMapper.updateManageBuilding(manageBuilding);
    }

    /**
     * 批量删除楼栋
     * 
     * @param buildingIds 需要删除的楼栋主键
     * @return 结果
     */
    @Override
    public int deleteManageBuildingByBuildingIds(Long[] buildingIds)
    {
        return manageBuildingMapper.deleteManageBuildingByBuildingIds(buildingIds);
    }

    /**
     * 删除楼栋信息
     * 
     * @param buildingId 楼栋主键
     * @return 结果
     */
    @Override
    public int deleteManageBuildingByBuildingId(Long buildingId)
    {
        return manageBuildingMapper.deleteManageBuildingByBuildingId(buildingId);
    }
}
